package com.datang.springcode.javaRegisterBean;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ImportResource;

//扫描包下的注解
@ComponentScan(value = "com.datang.springcode")
//加载xml
@ImportResource(value = "classpath:xmlRegisterBean.xml")
public class RegisterBeanConfig {

    //这个注解才是真正的java注册bean的关键，可以指定多个value值，第一个往后，为别名
    @Bean(value = {"banana", "banana2", "banana3"})
    public Banana getBanana() {
        return new Banana();
    }
}
